package org.zsl.ioc.app.z.app;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.zsl.ioc.app.z.model.Role;
import org.zsl.ioc.app.z.service.RoleService;

public class Client2 {

    /**
     *   javabean
     *   实例
     *   对象
     * */

    public static void main(String[] args) {
        Role role = new Role();
        role.setRoleName("管理员");

        ApplicationContext context =
                  new ClassPathXmlApplicationContext("classpath:spring4.xml");

        RoleService service = (RoleService) context.getBean("roleService");

        service.addRole(role);
    }
}
